]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Use Clutter.grab() for DnD grab
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 17 Nov 2021 23:41:20 +0000 (00:41 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 29 Jan 2022 00:16:30 +0000 (01:16 +0100)
We still listen to an specific device or touch sequence, but we
don't grab it specifically.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>

js/ui/dnd.js

index cefde6f603d846ca5a2e56f07d956b06ca264cfb..f6324f14e042d7b1b6f6501a76dc74224b3e7b0b 100644 (file)
@@ -165,11 +165,7 @@ var _Draggable = class _Draggable {
     }
 
     _grabDevice(actor, pointer, touchSequence) {
-        if (touchSequence)
-            pointer.sequence_grab(touchSequence, actor);
-        else if (pointer)
-            pointer.grab(actor);
-
+        this._grab = global.stage.grab(actor);
         this._grabbedDevice = pointer;
         this._touchSequence = touchSequence;
 
@@ -188,11 +184,10 @@ var _Draggable = class _Draggable {
             this._capturedEventId = 0;
         }
 
-        if (this._touchSequence)
-            this._grabbedDevice.sequence_ungrab(this._touchSequence);
-        else
-            this._grabbedDevice.ungrab();
-
+        if (this._grab) {
+            this._grab.dismiss();
+            this._grab = null;
+        }
         this._touchSequence = null;
         this._grabbedDevice = null;
     }